<template>
  <div>
    <ul>
      <li v-for="item in list" :key="item.id">
        <router-link :to="'/playlist?id=' + item.id">{{ item.name }}</router-link>
      </li>
    </ul>
  </div>
</template>

<script>
// import { getPersonalized } from '@/api/song.js'
export default {
  data() {
    return {
      name: 'SongList',
      // 歌单获取的数据放在这
      list: []
    }
  },
  created() {
    this.getList()
  },
  methods: {
    async getList() {
      const { data: res } = await this.$http.get('/personalized')
      this.list = res.result
      console.log(this.list)
    }
  }
}
</script>

<style></style>
